package com.xxx.user.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xxx.user.domain.entity.RoleMenuDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMenuMapper extends BaseMapper<RoleMenuDO> {

    @Insert({
            "<script>",
            "INSERT INTO sys_role_menu ",
            "(role_id, menu_id )",
            "VALUES",
            "<foreach collection='list' item='item' separator=','>",
            "(#{item.roleId}, #{item.menuId})",
            "</foreach>",
            "</script>"
    })
    void batchInsert(@Param("list") List<RoleMenuDO> list);
}




